import Vue from 'vue'
import Router from 'vue-router'
/* Layout */
import Layout from '@/layout/index.vue'
Vue.use(Router)
const router = new Router({
  mode: 'history',
  base: process.env.VUE_APP_CONTEXT,
  routes: [
    // {
    //   path: '/login',
    //   name: 'login',
    //   // meta: { title: '选择角色' },
    //   component: () => import('@/views/home/index.vue')
    // },
    {
      path: '/',
      // meta: { title: '首页' },
      component: Layout,
      redirect: '/home',
      children: [
        {
          path: '/home',
          name: 'home',
          meta: { title: '个人工作台' },
          component: () => import('@/views/home/home.vue')
        },
        {
          path: '/oaDocument',
          name: 'oaDocument',
          meta: { title: 'oa公文中心' },
          component: () => import('@/views/taskCenter/oaDocument.vue')
        },
        {
          path: '/propertyRegister',
          name: 'propertyRegister',
          meta: { title: '产权登记中心' },
          component: () => import('@/views/taskCenter/propertyRegister.vue')
        },
        {
          path: '/query',
          name: 'query',
          meta: { title: '公司查询' },
          component: () => import('@/views/propertyRightManage/query.vue')
        },
        {
          path: '/propertyRightAdd',
          name: 'propertyRightAdd',
          // meta: { title: '产权新增' },
          component: () => import('@/views/propertyRightAdd/index.vue')
        },
        {
          path: '/securitiesAccount',
          name: 'securitiesAccount',
          // meta: { title: '证券账户' },
          component: () => import('@/views/propertyRightManage/securitiesAccount/index.vue')
        },
        {
          path: '/financialKpi',
          name: 'financialKpi',
          // meta: { title: '财务指标' },
          component: () => import('@/views/propertyRightManage/financialKpi/index.vue')
        },
        {
          path: '/shareType',
          name: 'shareType',
          // meta: { title: '股东类别' },
          component: () => import('@/views/propertyRightManage/shareType/index.vue')
        },
        {
          path: '/detail',
          name: 'detail',
          // meta: { title: '产权查询-查看' },
          component: () => import('@/views/propertyRightManage/detail.vue')
        },
        {
          path: '/propertyRightEdit',
          name: 'propertyRightEdit',
          // meta: { title: '产权查询-修改' },
          component: () => import('@/views/propertyRightEdit/detail.vue')
        },
        {
          path: '/legalManage',
          name: 'legalManage',
          // meta: { title: '法人信息管理' },
          component: () => import('@/views/legalAndNatural/legal.vue')
        },
        {
          path: '/naturalManage',
          name: 'naturalManage',
          // meta: { title: '自然人信息管理' },
          component: () => import('@/views/legalAndNatural/natural.vue')
        },
        {
          path: '/checkReport',
          name: 'checkReport',
          // meta: { title: '稽核报告' },
          component: () => import('@/views/dataCheckManage/checkReport.vue')
        },
        {
          path: '/checkTask',
          name: 'checkTask',
          // meta: { title: '稽核任务' },
          component: () => import('@/views/dataCheckManage/checkTask.vue')
        },
        {
          path: '/warningKpi',
          name: 'warningKpi',
          // meta: { title: '预警指标管理' },
          component: () => import('@/views/warningManage/warningKpi/index.vue')
        },
        {
          path: '/warningRules',
          name: 'warningRules',
          // meta: { title: '预警规则管理' },
          component: () => import('@/views/warningManage/warningRules/index.vue')
        },
        {
          path: '/warningQuery',
          name: 'warningQuery',
          // meta: { title: '预警查询' },
          component: () => import('@/views/warningManage/warningQuery/index.vue')
        },
        {
          path: '/targetDefine',
          name: 'targetDefine',
          // meta: { title: '指标定义' },
          component: () => import('@/views/warningManage/targetDefine/index.vue')
        },
        {
          path: '/ruleSetting',
          name: 'ruleSetting',
          // meta: { title: '规则设置' },
          component: () => import('@/views/warningManage/ruleSetting/index.vue')
        },
        {
          path: '/targetData',
          name: 'targetData',
          // meta: { title: '指标数据' },
          component: () => import('@/views/warningManage/targetData/index.vue')
        },
        {
          path: '/warningDetail',
          name: 'warningDetail',
          // meta: { title: '预警' },
          component: () => import('@/views/warningManage/warningDetail/index.vue')
        },
        {
          path: '/archivesManage',
          name: 'archivesManage',
          // meta: { title: '档案维护' },
          component: () => import('@/views/archivesManage/index.vue')
        },
        {
          path: '/basicdata',
          name: 'basicdata',
          // meta: { title: '基础数据管理' },
          component: () => import('@/views/systemSeting/basicdata/basicdata.vue')
        },
        {
          path: '/dataMap',
          name: 'dataMap',
          // meta: { title: '数据映射管理' },
          component: () => import('@/views/systemSeting/dataMap/dataMap.vue')
        },
        {
          path: '/jurisdictionManage',
          name: 'jurisdictionManage',
          // meta: { title: '权限管理' },
          component: () => import('@/views/systemSeting/jurisdictionManage/index.vue')
        },
        {
          path: '/dataHistory',
          name: 'dataHistory',
          // meta: { title: '数据同步历史' },
          component: () => import('@/views/qzConnect/dataHistory.vue')
        },
        {
          path: '/rateManage',
          name: 'rateManage',
          // meta: { title: '公司同步频率配置' },
          component: () => import('@/views/qzConnect/rateManage.vue')
        },
        {
          path: '/shareChart',
          name: 'shareChart',
          // meta: { title: '股权图' },
          component: () => import('@/views/statistics/shareChart/index.vue')
        },
        {
          path: '/tongjifenxi',
          name: 'tongjifenxi',
          // meta: { title: '统计分析' },
          component: () => import('@/views/statistics/statisticsTable/index.vue')
        }
      ]
    }
  ]

})

router.afterEach((to, form) => {
  // const meta = to.meta
  // if (meta && meta.title) {
  // document.title = meta.title
  document.title = '招商局集团产权综合管理系统'
  // }
})
window.$Router = router
export default router
